#!/bin/bash
if [ -e jct-pid.txt ]
then
    a=`cat jct-pid.txt`
    echo "kill -9 $a" && kill -9 $a
    rm -rf 'jct-pid.txt'
fi
if [ -e Jct.jar ]
then
    echo 'Jct.jar exist'
else
    ln -s ~/git-publicfiles/java/Jct.jar ./Jct.jar
fi
if [ -e files ]
then
    echo '存在文件:' && ls files
else
    mkdir files
fi
nohup java -jar Jct.jar http-server ./files -p 9001 > logs.txt 2>&1 &
echo $! > jct-pid.txt
sleep 2
cat logs.txt
echo -e 'pid=\c' && cat jct-pid.txt
